﻿using System;
namespace Diversity.Robotics.Navigation
{
    /// <summary>
    /// Describes perfect motion and associated noise
    /// </summary>
    public interface IMotionModel
    {
        /// <summary>
        /// Used to distinguish between models
        /// </summary>
        /// <returns></returns>
        string ModelType();

        /// <summary>
        /// Gets a sample of the motion model with no added noise
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        Pose2D GetPerfectSample(Pose2D state);

        /// <summary>
        /// Gets the probability of a move from the motion model
        /// </summary>
        /// <param name="newState">The transformed state</param>
        /// <param name="oldState">The original state</param>
        /// <returns></returns>
        double GetProbabilityOfSample(Pose2D newState, Pose2D oldState);

        /// <summary>
        /// Gets a sample from the given motion model
        /// </summary>
        /// <param name="state">The state you want to move</param>
        /// <returns>A sample of the motion model with added Gaussian noise</returns>
        Pose2D GetSample(Pose2D state);

        /// <summary>
        /// Used with the velocity motion model to speed up sampling
        /// </summary>
        /// <param name="velocityOfAction">The velocity</param>
        /// <param name="timeOfAction">The length of time</param>
        void PrepareForSampling(Velocity velocityOfAction, TimeSpan timeOfAction);


        /// <summary>
        /// Used with the odometry motion model to speed up sampling
        /// </summary>
        /// <param name="odoState"></param>
        /// <param name="odoStatePrev"></param>
        void PrepareForSampling(Pose2D odoState, Pose2D odoStatePrev);
    }
}
